<!DOCTYPE html>
<html lang="ko">
  	<head>
	  	<meta charset="UTF-8">
	    <title>jQuery(ajax)</title>
        <script src="http://code.jquery.com/jquery-latest.js"></script>
  	</head>
  	<body>
  		<div id="result"></div>
        <input type="text" id="msg" />
        <input type="button" value="get result" id="getResult" />
        <script>
            $('#getResult').click( function() {
                $('#result').html('');
                $.ajax({
                    url:'http://localhost:8080/ygPHP/example_jquery_ajax.php',
                    dataType:'json',
                    type:'POST',
                    data:{'msg':$('#msg').val()},
                    success:function(result){
                        if(result['result']==true){
                            $('#result').html(result['msg']);
                        }
                    }
                });
            })
        </script>
  	</body>
</html>